<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="root"></div>
    <!-- React的核心库，与宿主环境无关 -->
    <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <!-- 依赖核心库，将核心的功能与页面结合 -->
    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <!-- 编译JSX -->
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

    <script type="text/babel">
        //创建一个span元素
        // var span = React.createElement("span", {}, "一个span元素");
        // var span = <span>一个span元素</span>
        //创建一个H1元素
        // var h1 = React.createElement("h1", {
        //     title: "第一个React元素"
        // }, "Hello", "World", span);
        // var h1 = <h1 title="第一个React元素">Hello World <span>一个span元素</span></h1>;
        // console.log(h1);
        ReactDOM.render(<h1 title="第一个React元素">Hello World <span>一个span元素</span></h1>, document.getElementById("root"));
    </script>
</body>

</html>
